package com.tornado.system.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tornado.system.mapper.NewsMapper;
import com.tornado.system.model.News;

@Service
public class NewsService implements InewsService{

	@Autowired
private NewsMapper newsMapper;

	/*
	 * 查询所有(non-Javadoc)
	 * @see com.tornado.system.service.InewsService#selectAll()
	 */
	public List<News> selectAll() {
		// TODO Auto-generated method stub
		return newsMapper.selectAll();
	}
	
	
	/*
	 * 查询一个
	 */
	public News selectByPrimaryKey(Integer newsId) {
		// TODO Auto-generated method stub
		return newsMapper.selectByPrimaryKey(newsId);
	}


	/*
	 * 根据id来删除(non-Javadoc)
	 * @see com.tornado.system.service.InewsService#deleteByPrimaryKey(java.lang.Integer)
	 */
	public int deleteByPrimaryKey(Integer newsId) {
		
		return newsMapper.deleteByPrimaryKey(newsId);
	}


	/*
	 * 插入一条数据(non-Javadoc)
	 * @see com.tornado.system.service.InewsService#insert(com.tornado.system.model.News)
	 */
	public int insert(News record) {
		
		return newsMapper.insert(record);
	}


	public int insertSelective(News record) {
		// TODO Auto-generated method stub
		return 0;
	}


	public int updateByPrimaryKeySelective(News record) {
		// TODO Auto-generated method stub
		return 0;
	}


	/*
	 * 更新数据(non-Javadoc)
	 * @see com.tornado.system.service.InewsService#updateByPrimaryKey(com.tornado.system.model.News)
	 */
	public int updateByPrimaryKeyWithBLOBs(News record) {
		
		return newsMapper.updateByPrimaryKeyWithBLOBs(record);
	}



	public int updateByPrimaryKey(News record) {
		
		return 0;
	}

	
	
}
